﻿using System;
using System.ComponentModel.DataAnnotations.Schema;
using Volo.Abp.Domain.Entities;

namespace HCMS.Entities.Manage
{
    /// <summary>
    /// 管理员 操作 日志
    /// </summary>
    [Table("admin_action_logs")]
    public class AdminActionLogs : Entity<int>
    {
        /// <summary>
        /// Id
        /// </summary>
        public new int Id { get; set; }

        /// <summary>
        /// 创建 时间
        /// </summary>
        [Column("create_time")]
        public DateTime CreateTime { get; set; } = DateTime.Now;

        /// <summary>
        /// 管理员 Id
        /// </summary>
        [Column("admin_id")]
        public int AdminId { get; set; }

        /// <summary>
        /// 请求方法
        /// </summary>
        /// <remarks>
        /// [POST]、[GET] 等
        /// </remarks>
        [Column("http_method")]
        public string HttpMethod { get; set; } = "";

        /// <summary>
        /// 控制器 名称
        /// </summary>
        [Column("controller_name")]
        public string ControllerName { get; set; } = "";

        /// <summary>
        /// 方法 名称
        /// </summary>
        [Column("action_name")]
        public string ActionName { get; set; } = "";

        /// <summary>
        /// 请求 参数
        /// </summary>
        [Column("parameter")]
        public string Parameter { get; set; } = "";

        /// <summary>
        /// 开始 时间
        /// </summary>
        [Column("start_time")]
        public DateTime StartTime { get; set; }

        /// <summary>
        /// 结束 时间
        /// </summary>
        [Column("end_time")]
        public DateTime EndTime { get; set; }

        /// <summary>
        /// 执行 耗时
        /// </summary>
        [Column("execution_time")]
        public int ExecutionTime { get; set; }

        /// <summary>
        /// 请求头信息
        /// </summary>
        [Column("header_info")]
        public string HeaderInfo { get; set; } = "";

        /// <summary>
        /// 上一个链接
        /// </summary>
        [Column("referer_url")]
        public string RefererUrl { get; set; } = "";

        /// <summary>
        /// 当前链接
        /// </summary>
        [Column("url")]
        public string Url { get; set; } = "";

        /// <summary>
        /// IP 地址
        /// </summary>
        [Column("ip")]
        public string Ip { get; set; } = "";

        /// <summary>
        /// 浏览器
        /// </summary>
        [Column("brower")]
        public string Brower { get; set; } = "";

        /// <summary>
        /// 返回 结果
        /// </summary>
        [Column("result_info")]
        public string ResultInfo { get; set; } = "";
    }
}
